var Authority = [
	{name : "用户组管理", items : [
		{name : "用户组管理", authority : "Technique.UserGroupManagement", objName : "App.UserGroupManagement"}
	]},
	{name : "用户管理", items : [
		{name : "用户录入", authority : "Technique.WebsiteManagement.UserManagement.Inserting", objName : "App.UserManagement.Inserting"},
		{name : "Fido卡申请管理", authority : "Technique.WebsiteManagement.UserManagement.CardApplicationViewing", objName : "App.UserManagement.CardApplicationViewing"}
	]},
	{name : "地图管理", items : [
		{name : "地点图片管理", authority : "Technique.WebsiteManagement.MapManagement.SchoolMapLocPicManagement", objName : "App.MapManagement.SchoolMapLocPicManagement"},
		{name : "优惠管理", authority : "Technique.WebsiteManagement.MapManagement.DiscountManagement", objName : "App.MapManagement.DiscountManagement"}
	]},
	{name : "媒体", items : [
		{name : "139邮件发送", authority : "Media.139Mail.MessageSending", objName : "App.139Mail.MessageSending"}
	]}
]

Ext.onReady(function(){
	var operationTree = new OperationTree();
	var panel = new Ext.Panel({
		region : "center",
		layout : "anchor",
		html : "<div style='text-align:center;width:100%;'>请选择管理项目...</div>"
	});
	
	var viewport = new Ext.Viewport({
		layout : 'border',
		items : [
			new Ext.BoxComponent({
				region : "north",
				el : "header",
				height : 50
			}),
			operationTree,
			panel
		]
	});
	
	operationTree.on({
		"nodeclick" : function(objName){
			panel.update("");
			panel.removeAll();
			panel.add({xtype : objName});
			panel.doLayout();
		}
	})
	
	setTimeout(function(){
        Ext.get('loading').remove();
        Ext.get('loading-mask').fadeOut({remove:true});
    }, 250);
});
